var app = getApp();

// import { bodyLays } from "../../utils/testPersonData"
import TWEEN from '../../../pages/canvas/tween.js';

var current_rot = 0;
var ZW_Current_Index = 0;
var ZW_ClickPos;

function animation() {
    var times = 0
    var i = setInterval(function () {
        TWEEN.update();
    }, 20)
}

Component({
    properties: {
        textOne: {
            type: String
        },
        inMenuItemData: {
            type: Array
        }
    },

    data: {
        cardUrl0:'https://morefun-active-1.oss-cn-shanghai.aliyuncs.com/2022_vansdress_jd/card/card-c0.jpg',
        cardUrl1:'https://morefun-active-1.oss-cn-shanghai.aliyuncs.com/2022_vansdress_jd/card/card-c1.jpg',
        cardUrl2:'https://morefun-active-1.oss-cn-shanghai.aliyuncs.com/2022_vansdress_jd/card/card-c2.jpg',
        cardUrl3:'https://morefun-active-1.oss-cn-shanghai.aliyuncs.com/2022_vansdress_jd/card/card-c3.jpg',
        cardUrl4:'https://morefun-active-1.oss-cn-shanghai.aliyuncs.com/2022_vansdress_jd/card/card-c4.jpg',
        cardUrl5:'https://morefun-active-1.oss-cn-shanghai.aliyuncs.com/2022_vansdress_jd/card/card-c5.jpg',

        cardLeft:0,
        cardTop:0,

        cardLeft0:170,
        cardTop0:200,

        cardLeft1:120,
        cardTop1:200+794*0.1,

        cardLeft2:70,
        cardTop2:200+794*0.2,

        cardLeft3:20,
        cardTop3:200+794*0.3,

        cardLeft4:-30,
        cardTop4:200+794*0.4,

        cardLeft5:-80,
        cardTop5:200+794*0.5,

        scaleValue0:1.0,
        scaleValue1:0.9,
        scaleValue2:0.8,
        scaleValue3:0.7,
        scaleValue4:0.6,
        scaleValue5:0.5,

        rotateValue0:0,
        rotateValue1:0,
        rotateValue2:0,
        rotateValue3:0,
        rotateValue4:0,
        rotateValue5:0,

        zValue0:5,
        zValue1:4,
        zValue2:3,
        zValue3:2,
        zValue4:1,
        zValue5:0,

        pLeft0:0,
        pLeft1:60,
        pLeft2:84,
        pLeft3:108,
        pLeft4:132,
        pLeft5:156,

        pGray0:0,
        pGray1:255,
        pGray2:255,
        pGray3:255,
        pGray4:255,
        pGray5:255,

        pWidth0:48,
        pWidth1:12,
        pWidth2:12,
        pWidth3:12,
        pWidth4:12,
        pWidth5:12,

        bRed:224,
        bGreen:197,
        bBlue:126,
    },

    attached() {

    },

    methods: {
        onTouchStart(e) {
            ZW_ClickPos = { x: e.touches[0].clientX, y: e.touches[0].clientY };
    
            // console.log(e);
            // jd.showToast({
            //     title: e.touches[0].clientX.toString() +','+ e.touches[0].clientY.toString(),
            //     icon: 'success',
            //     duration: 500
            // });
        },
        onTouchMove(e) {
            var clickPos = { x: e.touches[0].clientX, y: e.touches[0].clientY };
    
        
            var xOffset = clickPos.x - ZW_ClickPos.x;
            var yOffset = clickPos.y - ZW_ClickPos.y;
    
            current_rot -= xOffset*0.15;
    
            if(current_rot > 0 || current_rot < -40 ) current_rot += xOffset*0.15;
    
            if(ZW_Current_Index == 0)
            {   
                this.setData({
                    rotateValue0: current_rot
                })
            }else if(ZW_Current_Index == 1)
            {
                this.setData({
                    rotateValue1: current_rot
                })
            }else if(ZW_Current_Index == 2)
            {
                this.setData({
                    rotateValue2: current_rot
                })
            }else if(ZW_Current_Index == 3)
            {
                this.setData({
                    rotateValue3: current_rot
                })
            }else if(ZW_Current_Index == 4)
            {
                this.setData({
                    rotateValue4: current_rot
                })
            }else if(ZW_Current_Index == 5)
            {
                this.setData({
                    rotateValue5: current_rot
                })
            }
            
    
            ZW_ClickPos = clickPos;
            // jd.showToast({
            //     title: 'move!!!',
            //     icon: 'success',
            //     duration: 500
            // })
        },
        onTouchEnd(e) {
           var that = this;
    
           if(ZW_Current_Index == 0)
            {   
                if(current_rot < -15) {
                    var coords = { x0: 170,y0: 200,x1: 170-50,y1: 200+794*0.1,x2: 170-50*2,y2: 200+794*0.2,
                        x3: 170-50*3,y3: 200+794*0.3,x4: 170-50*4,y4: 200+794*0.4,x5: 170-50*5,y5: 200+794*0.5,
                        s0:1.0,s1:0.9,s2:0.8,s3:0.7,s4:0.6,s5:0.5,
                        pGray0:0,pGray1:255,pGray2:255,pGray3:255,pGray4:255,pGray5:255,
                        pWidth0:48,pWidth1:12,pWidth2:12,pWidth3:12,pWidth4:12,pWidth5:12,
                        pLeft0:0,pLeft1:60,pLeft2:84,pLeft3:108,pLeft4:132,pLeft5:156};
                    new TWEEN.Tween(coords)
                        .to({ x0: 1000,y0:200, x1: 170,y1: 200+794*0.0,x2: 170-50*1,y2: 200+794*0.1,x3: 170-50*2,
                            y3: 200+794*0.2,x4: 170-50*3,y4: 200+794*0.3,x5: 170-50*4,y5: 200+794*0.4,
                            s0:1.0,s1:1.0,s2:0.9,s3:0.8,s4:0.7,s5:0.6,
                            pGray0:255,pGray1:0,pGray2:255,pGray3:255,pGray4:255,pGray5:255,
                            pWidth0:12,pWidth1:48,pWidth2:12,pWidth3:12,pWidth4:12,pWidth5:12,
                            pLeft0:0,pLeft1:24,pLeft2:84,pLeft3:108,pLeft4:132,pLeft5:156}, 300)
                        .repeat(0)
                        .easing(TWEEN.Easing.Linear.None)
                        .onUpdate(function () {
                            that.setData({
                                cardLeft0: coords.x0,
                                cardTop0: coords.y0,
                                cardLeft1: coords.x1,
                                cardTop1: coords.y1,
                                cardLeft2: coords.x2,
                                cardTop2: coords.y2,
                                cardLeft3: coords.x3,
                                cardTop3: coords.y3,
                                cardLeft4: coords.x4,
                                cardTop4: coords.y4,
                                cardLeft5: coords.x5,
                                cardTop5: coords.y5,
                                scaleValue0:coords.s0,
                                scaleValue1:coords.s1,
                                scaleValue2:coords.s2,
                                scaleValue3:coords.s3,
                                scaleValue4:coords.s4,
                                scaleValue5:coords.s5,
                                pGray0:coords.pGray0,
                                pGray1:coords.pGray1,
                                pGray2:coords.pGray2,
                                pGray3:coords.pGray3,
                                pGray4:coords.pGray4,
                                pGray5:coords.pGray5,
                                pWidth0:coords.pWidth0,
                                pWidth1:coords.pWidth1,
                                pWidth2:coords.pWidth2,
                                pWidth3:coords.pWidth3,
                                pWidth4:coords.pWidth4,
                                pWidth5:coords.pWidth5,
                                pLeft0:coords.pLeft0,
                                pLeft1:coords.pLeft1,
                                pLeft2:coords.pLeft2,
                                pLeft3:coords.pLeft3,
                                pLeft4:coords.pLeft4,
                                pLeft5:coords.pLeft5
                            })
                        }).onComplete(function () {
                            ZW_Current_Index = 1;
    
                            current_rot = 0;
    
                            that.setData({
                                cardLeft0: 170-50*5,
                                cardTop0: 200+794*0.5,
                                scaleValue0:0.5,
                                rotateValue0:0,
                                zValue0:0,
                                zValue1:5,
                                zValue2:4,
                                zValue3:3,
                                zValue4:2,
                                zValue5:1,
                                bRed:200,
                                bGreen:186,
                                bBlue:177
                            })
    
                        })
                        .delay(0)
                        .start();
                }
                if(current_rot > -15) {
                    this.setData({
                        rotateValue0: 0
                    })
                }
            }else if(ZW_Current_Index == 1)
            {
                if(current_rot < -15) {
                    var coords = { x0: 170-50*5,y0: 200+794*0.5,x1: 170,y1: 200,x2: 170-50*1,y2: 200+794*0.1,
                        x3: 170-50*2,y3: 200+794*0.2,x4: 170-50*3,y4: 200+794*0.3,x5: 170-50*4,y5: 200+794*0.4,
                        s0:0.5,s1:1.0,s2:0.9,s3:0.8,s4:0.7,s5:0.6,
                        pGray0:255,pGray1:0,pGray2:255,pGray3:255,pGray4:255,pGray5:255,
                        pWidth0:12,pWidth1:48,pWidth2:12,pWidth3:12,pWidth4:12,pWidth5:12,
                        pLeft0:0,pLeft1:24,pLeft2:84,pLeft3:108,pLeft4:132,pLeft5:156};
                    new TWEEN.Tween(coords)
                        .to({ x0: 170-50*4,y0:200+794*0.4, x1: 1000,y1: 200,x2: 170-50*0,y2: 200+794*0.0,
                            x3: 170-50*1,y3: 200+794*0.1,x4: 170-50*2,y4: 200+794*0.2,x5: 170-50*3,y5: 200+794*0.3,
                            s0:0.6,s1:1.0,s2:1.0,s3:0.9,s4:0.8,s5:0.7,
                            pGray0:255,pGray1:255,pGray2:0,pGray3:255,pGray4:255,pGray5:255,
                            pWidth0:12,pWidth1:12,pWidth2:48,pWidth3:12,pWidth4:12,pWidth5:12,
                            pLeft0:0,pLeft1:24,pLeft2:48,pLeft3:108,pLeft4:132,pLeft5:156}, 300)
                        .repeat(0)
                        .easing(TWEEN.Easing.Linear.None)
                        .onUpdate(function () {
                            that.setData({
                                cardLeft0: coords.x0,
                                cardTop0: coords.y0,
                                cardLeft1: coords.x1,
                                cardTop1: coords.y1,
                                cardLeft2: coords.x2,
                                cardTop2: coords.y2,
                                cardLeft3: coords.x3,
                                cardTop3: coords.y3,
                                cardLeft4: coords.x4,
                                cardTop4: coords.y4,
                                cardLeft5: coords.x5,
                                cardTop5: coords.y5,
                                scaleValue0:coords.s0,
                                scaleValue1:coords.s1,
                                scaleValue2:coords.s2,
                                scaleValue3:coords.s3,
                                scaleValue4:coords.s4,
                                scaleValue5:coords.s5,
                                pGray0:coords.pGray0,
                                pGray1:coords.pGray1,
                                pGray2:coords.pGray2,
                                pGray3:coords.pGray3,
                                pGray4:coords.pGray4,
                                pGray5:coords.pGray5,
                                pWidth0:coords.pWidth0,
                                pWidth1:coords.pWidth1,
                                pWidth2:coords.pWidth2,
                                pWidth3:coords.pWidth3,
                                pWidth4:coords.pWidth4,
                                pWidth5:coords.pWidth5,
                                pLeft0:coords.pLeft0,
                                pLeft1:coords.pLeft1,
                                pLeft2:coords.pLeft2,
                                pLeft3:coords.pLeft3,
                                pLeft4:coords.pLeft4,
                                pLeft5:coords.pLeft5
                            })
                        }).onComplete(function () {
                            ZW_Current_Index = 2;
    
                            current_rot = 0;
    
                            that.setData({
                                cardLeft1: 170-50*5,
                                cardTop1: 200+794*0.5,
                                scaleValue1:0.5,
                                rotateValue1:0,
                                zValue0:1,
                                zValue1:0,
                                zValue2:5,
                                zValue3:4,
                                zValue4:3,
                                zValue5:2,
                                bRed:207,
                                bGreen:189,
                                bBlue:203
                            })
    
                        })
                        .delay(0)
                        .start();
                }
    
                if(current_rot > -15) {
                    this.setData({
                        rotateValue1: 0
                    })
                }
            }else if(ZW_Current_Index == 2)
            {
                if(current_rot < -15) {
                    var coords = { x0: 170-50*4,y0: 200+794*0.4,x1: 170-50*5,y1: 200+794*0.5,x2: 170-50*0,y2: 200+794*0.0,
                        x3: 170-50*1,y3: 200+794*0.1,x4: 170-50*2,y4: 200+794*0.2,x5: 170-50*3,y5: 200+794*0.3,
                        s0:0.6,s1:0.5,s2:1.0,s3:0.9,s4:0.8,s5:0.7,
                        pGray0:255,pGray1:255,pGray2:0,pGray3:255,pGray4:255,pGray5:255,
                            pWidth0:12,pWidth1:12,pWidth2:48,pWidth3:12,pWidth4:12,pWidth5:12,
                            pLeft0:0,pLeft1:24,pLeft2:48,pLeft3:108,pLeft4:132,pLeft5:156};
                    new TWEEN.Tween(coords)
                        .to({ x0: 170-50*3,y0:200+794*0.3, x1: 170-50*4,y1: 200+794*0.4,x2: 1000,y2: 200+794*0.0,
                            x3: 170-50*0,y3: 200+794*0.0,x4: 170-50*1,y4: 200+794*0.1,x5: 170-50*2,y5: 200+794*0.2,
                            s0:0.7,s1:0.6,s2:1.0,s3:1.0,s4:0.9,s5:0.8,
                            pGray0:255,pGray1:255,pGray2:255,pGray3:0,pGray4:255,pGray5:255,
                            pWidth0:12,pWidth1:12,pWidth2:12,pWidth3:48,pWidth4:12,pWidth5:12,
                            pLeft0:0,pLeft1:24,pLeft2:48,pLeft3:72,pLeft4:132,pLeft5:156}, 300)
                        .repeat(0)
                        .easing(TWEEN.Easing.Linear.None)
                        .onUpdate(function () {
                            that.setData({
                                cardLeft0: coords.x0,
                                cardTop0: coords.y0,
                                cardLeft1: coords.x1,
                                cardTop1: coords.y1,
                                cardLeft2: coords.x2,
                                cardTop2: coords.y2,
                                cardLeft3: coords.x3,
                                cardTop3: coords.y3,
                                cardLeft4: coords.x4,
                                cardTop4: coords.y4,
                                cardLeft5: coords.x5,
                                cardTop5: coords.y5,
                                scaleValue0:coords.s0,
                                scaleValue1:coords.s1,
                                scaleValue2:coords.s2,
                                scaleValue3:coords.s3,
                                scaleValue4:coords.s4,
                                scaleValue5:coords.s5,
                                pGray0:coords.pGray0,
                                pGray1:coords.pGray1,
                                pGray2:coords.pGray2,
                                pGray3:coords.pGray3,
                                pGray4:coords.pGray4,
                                pGray5:coords.pGray5,
                                pWidth0:coords.pWidth0,
                                pWidth1:coords.pWidth1,
                                pWidth2:coords.pWidth2,
                                pWidth3:coords.pWidth3,
                                pWidth4:coords.pWidth4,
                                pWidth5:coords.pWidth5,
                                pLeft0:coords.pLeft0,
                                pLeft1:coords.pLeft1,
                                pLeft2:coords.pLeft2,
                                pLeft3:coords.pLeft3,
                                pLeft4:coords.pLeft4,
                                pLeft5:coords.pLeft5
                            })
                        }).onComplete(function () {
                            ZW_Current_Index = 3;
    
                            current_rot = 0;
    
                            that.setData({
                                cardLeft2: 170-50*5,
                                cardTop2: 200+794*0.5,
                                scaleValue2:0.5,
                                rotateValue2:0,
                                zValue0:2,
                                zValue1:1,
                                zValue2:0,
                                zValue3:5,
                                zValue4:4,
                                zValue5:3,
                                bRed:224,
                                bGreen:179,
                                bBlue:126
                            });
                        })
                        .delay(0)
                        .start();
                }
    
                if(current_rot > -15) {
                    this.setData({
                        rotateValue2: 0
                    })
                }
            }else if(ZW_Current_Index == 3)
            {
                if(current_rot < -15) {
                    var coords = { x0: 170-50*3,y0: 200+794*0.3,x1: 170-50*4,y1: 200+794*0.4,x2: 170-50*5,y2: 200+794*0.5,
                        x3: 170-50*0,y3: 200+794*0.0,x4: 170-50*1,y4: 200+794*0.1,x5: 170-50*2,y5: 200+794*0.2,
                        s0:0.7,s1:0.6,s2:0.5,s3:1.0,s4:0.9,s5:0.8,
                        pGray0:255,pGray1:255,pGray2:255,pGray3:0,pGray4:255,pGray5:255,
                            pWidth0:12,pWidth1:12,pWidth2:12,pWidth3:48,pWidth4:12,pWidth5:12,
                            pLeft0:0,pLeft1:24,pLeft2:48,pLeft3:72,pLeft4:132,pLeft5:156};
                    new TWEEN.Tween(coords)
                        .to({ x0: 170-50*2,y0:200+794*0.2, x1: 170-50*3,y1: 200+794*0.3,x2: 170-50*4,y2: 200+794*0.4,
                            x3: 1000,y3: 200+794*0.0,x4: 170-50*0,y4: 200+794*0.0,x5: 170-50*1,y5: 200+794*0.1,
                            s0:0.8,s1:0.7,s2:0.6,s3:1.0,s4:1.0,s5:0.9,
                            pGray0:255,pGray1:255,pGray2:255,pGray3:255,pGray4:0,pGray5:255,
                            pWidth0:12,pWidth1:12,pWidth2:12,pWidth3:12,pWidth4:48,pWidth5:12,
                            pLeft0:0,pLeft1:24,pLeft2:48,pLeft3:72,pLeft4:96,pLeft5:156}, 300)
                        .repeat(0)
                        .easing(TWEEN.Easing.Linear.None)
                        .onUpdate(function () {
                            that.setData({
                                cardLeft0: coords.x0,
                                cardTop0: coords.y0,
                                cardLeft1: coords.x1,
                                cardTop1: coords.y1,
                                cardLeft2: coords.x2,
                                cardTop2: coords.y2,
                                cardLeft3: coords.x3,
                                cardTop3: coords.y3,
                                cardLeft4: coords.x4,
                                cardTop4: coords.y4,
                                cardLeft5: coords.x5,
                                cardTop5: coords.y5,
                                scaleValue0:coords.s0,
                                scaleValue1:coords.s1,
                                scaleValue2:coords.s2,
                                scaleValue3:coords.s3,
                                scaleValue4:coords.s4,
                                scaleValue5:coords.s5,
                                pGray0:coords.pGray0,
                                pGray1:coords.pGray1,
                                pGray2:coords.pGray2,
                                pGray3:coords.pGray3,
                                pGray4:coords.pGray4,
                                pGray5:coords.pGray5,
                                pWidth0:coords.pWidth0,
                                pWidth1:coords.pWidth1,
                                pWidth2:coords.pWidth2,
                                pWidth3:coords.pWidth3,
                                pWidth4:coords.pWidth4,
                                pWidth5:coords.pWidth5,
                                pLeft0:coords.pLeft0,
                                pLeft1:coords.pLeft1,
                                pLeft2:coords.pLeft2,
                                pLeft3:coords.pLeft3,
                                pLeft4:coords.pLeft4,
                                pLeft5:coords.pLeft5
                            })
                        }).onComplete(function () {
                            ZW_Current_Index = 4;
    
                            current_rot = 0;
    
                            that.setData({
                                cardLeft3: 170-50*5,
                                cardTop3: 200+794*0.5,
                                scaleValue3:0.5,
                                rotateValue3:0,
                                zValue0:3,
                                zValue1:2,
                                zValue2:1,
                                zValue3:0,
                                zValue4:5,
                                zValue5:4,
                                bRed:207,
                                bGreen:189,
                                bBlue:203
                            });
                        })
                        .delay(0)
                        .start();
                }
    
                if(current_rot > -15) {
                    this.setData({
                        rotateValue3: 0
                    })
                }
            }else if(ZW_Current_Index == 4)
            {
    
                if(current_rot < -15) {
                    var coords = { x0: 170-50*2,y0: 200+794*0.2,x1: 170-50*3,y1: 200+794*0.3,x2: 170-50*4,y2: 200+794*0.4,
                        x3: 170-50*5,y3: 200+794*0.5,x4: 170-50*0,y4: 200+794*0.0,x5: 170-50*1,y5: 200+794*0.1,
                        s0:0.8,s1:0.7,s2:0.6,s3:0.5,s4:1.0,s5:0.9,
                        pGray0:255,pGray1:255,pGray2:255,pGray3:255,pGray4:0,pGray5:255,
                            pWidth0:12,pWidth1:12,pWidth2:12,pWidth3:12,pWidth4:48,pWidth5:12,
                            pLeft0:0,pLeft1:24,pLeft2:48,pLeft3:72,pLeft4:96,pLeft5:156};
                    new TWEEN.Tween(coords)
                        .to({ x0: 170-50*1,y0:200+794*0.1, x1: 170-50*2,y1: 200+794*0.2,x2: 170-50*3,y2: 200+794*0.3,
                            x3: 170-50*4,y3: 200+794*0.4,x4: 1000,y4: 200+794*0.0,x5: 170-50*0,y5: 200+794*0.0,
                            s0:0.9,s1:0.8,s2:0.7,s3:0.6,s4:1.0,s5:1.0,
                            pGray0:255,pGray1:255,pGray2:255,pGray3:255,pGray4:255,pGray5:0,
                            pWidth0:12,pWidth1:12,pWidth2:12,pWidth3:12,pWidth4:12,pWidth5:48,
                            pLeft0:0,pLeft1:24,pLeft2:48,pLeft3:72,pLeft4:96,pLeft5:120}, 300)
                        .repeat(0)
                        .easing(TWEEN.Easing.Linear.None)
                        .onUpdate(function () {
                            that.setData({
                                cardLeft0: coords.x0,
                                cardTop0: coords.y0,
                                cardLeft1: coords.x1,
                                cardTop1: coords.y1,
                                cardLeft2: coords.x2,
                                cardTop2: coords.y2,
                                cardLeft3: coords.x3,
                                cardTop3: coords.y3,
                                cardLeft4: coords.x4,
                                cardTop4: coords.y4,
                                cardLeft5: coords.x5,
                                cardTop5: coords.y5,
                                scaleValue0:coords.s0,
                                scaleValue1:coords.s1,
                                scaleValue2:coords.s2,
                                scaleValue3:coords.s3,
                                scaleValue4:coords.s4,
                                scaleValue5:coords.s5,
                                pGray0:coords.pGray0,
                                pGray1:coords.pGray1,
                                pGray2:coords.pGray2,
                                pGray3:coords.pGray3,
                                pGray4:coords.pGray4,
                                pGray5:coords.pGray5,
                                pWidth0:coords.pWidth0,
                                pWidth1:coords.pWidth1,
                                pWidth2:coords.pWidth2,
                                pWidth3:coords.pWidth3,
                                pWidth4:coords.pWidth4,
                                pWidth5:coords.pWidth5,
                                pLeft0:coords.pLeft0,
                                pLeft1:coords.pLeft1,
                                pLeft2:coords.pLeft2,
                                pLeft3:coords.pLeft3,
                                pLeft4:coords.pLeft4,
                                pLeft5:coords.pLeft5
                            })
                        }).onComplete(function () {
                            ZW_Current_Index = 5;
    
                            current_rot = 0;
    
                            that.setData({
                                cardLeft4: 170-50*5,
                                cardTop4: 200+794*0.5,
                                scaleValue4:0.5,
                                rotateValue4:0,
                                zValue0:4,
                                zValue1:3,
                                zValue2:2,
                                zValue3:1,
                                zValue4:0,
                                zValue5:5,
                                bRed:74,
                                bGreen:158,
                                bBlue:192
                            });
                        })
                        .delay(0)
                        .start();
                }
    
                if(current_rot > -15) {
                    this.setData({
                        rotateValue4: 0
                    })
                }
            }else if(ZW_Current_Index == 5)
            {
                if(current_rot < -15) {
                    var coords = { x0: 170-50*1,y0: 200+794*0.1,x1: 170-50*2,y1: 200+794*0.2,x2: 170-50*3,y2: 200+794*0.3,
                        x3: 170-50*4,y3: 200+794*0.4,x4: 170-50*5,y4: 200+794*0.5,x5: 170-50*0,y5: 200+794*0.0,
                        s0:0.9,s1:0.8,s2:0.7,s3:0.6,s4:0.5,s5:1.0,
                        pGray0:255,pGray1:255,pGray2:255,pGray3:255,pGray4:255,pGray5:0,
                            pWidth0:12,pWidth1:12,pWidth2:12,pWidth3:12,pWidth4:12,pWidth5:48,
                            pLeft0:0,pLeft1:24,pLeft2:48,pLeft3:72,pLeft4:96,pLeft5:120};
                    new TWEEN.Tween(coords)
                        .to({ x0: 170-50*0,y0:200+794*0.0, x1: 170-50*1,y1: 200+794*0.1,x2: 170-50*2,y2: 200+794*0.2,
                            x3: 170-50*3,y3: 200+794*0.3,x4: 170-50*4,y4: 200+794*0.4,x5: 1000,y5: 200+794*0.0,
                            s0:1.0,s1:0.9,s2:0.8,s3:0.7,s4:0.6,s5:1.0,
                            pGray0:0,pGray1:255,pGray2:255,pGray3:255,pGray4:255,pGray5:255,
                            pWidth0:48,pWidth1:12,pWidth2:12,pWidth3:12,pWidth4:12,pWidth5:12,
                            pLeft0:0,pLeft1:60,pLeft2:84,pLeft3:108,pLeft4:132,pLeft5:156}, 300)
                        .repeat(0)
                        .easing(TWEEN.Easing.Linear.None)
                        .onUpdate(function () {
                            that.setData({
                                cardLeft0: coords.x0,
                                cardTop0: coords.y0,
                                cardLeft1: coords.x1,
                                cardTop1: coords.y1,
                                cardLeft2: coords.x2,
                                cardTop2: coords.y2,
                                cardLeft3: coords.x3,
                                cardTop3: coords.y3,
                                cardLeft4: coords.x4,
                                cardTop4: coords.y4,
                                cardLeft5: coords.x5,
                                cardTop5: coords.y5,
                                scaleValue0:coords.s0,
                                scaleValue1:coords.s1,
                                scaleValue2:coords.s2,
                                scaleValue3:coords.s3,
                                scaleValue4:coords.s4,
                                scaleValue5:coords.s5,
                                pGray0:coords.pGray0,
                                pGray1:coords.pGray1,
                                pGray2:coords.pGray2,
                                pGray3:coords.pGray3,
                                pGray4:coords.pGray4,
                                pGray5:coords.pGray5,
                                pWidth0:coords.pWidth0,
                                pWidth1:coords.pWidth1,
                                pWidth2:coords.pWidth2,
                                pWidth3:coords.pWidth3,
                                pWidth4:coords.pWidth4,
                                pWidth5:coords.pWidth5,
                                pLeft0:coords.pLeft0,
                                pLeft1:coords.pLeft1,
                                pLeft2:coords.pLeft2,
                                pLeft3:coords.pLeft3,
                                pLeft4:coords.pLeft4,
                                pLeft5:coords.pLeft5
                            })
                        }).onComplete(function () {
                            ZW_Current_Index = 0;
    
                            current_rot = 0;
    
                            that.setData({
                                cardLeft5: 170-50*5,
                                cardTop5: 200+794*0.5,
                                scaleValue5:0.5,
                                rotateValue5:0,
                                zValue0:5,
                                zValue1:4,
                                zValue2:3,
                                zValue3:2,
                                zValue4:1,
                                zValue5:0,
                                bRed:224,
                                bGreen:197,
                                bBlue:126
                            });
                        })
                        .delay(0)
                        .start();
                }
    
                if(current_rot > -15) {
                    this.setData({
                        rotateValue5: 0
                    })
                }
            }
    
    
            // if(current_rot < -15) {
            //     // jd.showToast({
            //     //     title: '飞走',
            //     //     icon: 'success',
            //     //     duration: 500
            //     // })
    
            //     var coords = { x: 170 };
            //     new TWEEN.Tween(coords)
            //         .to({ x: 1000 }, 300)
            //         .repeat(0)
            //         .easing(TWEEN.Easing.Linear.None)
            //         .onUpdate(function () {
            //             that.setData({
            //                 cardLeft0: coords.x
            //             })
            //         })
            //         .delay(0)
            //         .start();
    
    
            //     // var tempAlphaAnimation = jd.createAnimation({
            //     //     duration: 200,
            //     //     timingFunction: 'cubic-bezier(0,0.14,1,0.18)',
            //     //     delay: 0
            //     // });
            //     // tempAlphaAnimation.left(1000).step();
    
            //     // //tempAlphaAnimation.translate(-50, 0).step();
    
            //     // this.setData({
            //     // mainAnimation6: tempAlphaAnimation.export()
            //     // })
    
    
            //     // this.setData({
            //     //     cardLeft: 1000
            //     // })
            // }
    
            // if(current_rot > -15) {
    
            //     this.setData({
            //         rotateValue0: 0
            //     })
    
            //     // jd.showToast({
            //     //     title: '返回',
            //     //     icon: 'success',
            //     //     duration: 500
            //     // })
    
            //     // var tempAlphaAnimation = jd.createAnimation({
            //     //     duration: 200,
            //     //     timingFunction: 'cubic-bezier(0,0.14,1,0.18)',
            //     //     delay: 0
            //     // });
            //     // tempAlphaAnimation.left(245).step()
    
            //     // this.setData({
            //     // mainAnimation1: tempAlphaAnimation.export()
            //     // })
            // }
    
            // var tempAlphaAnimation = jd.createAnimation({
            //     duration: 200,
            //     timingFunction: 'cubic-bezier(0,0.14,1,0.18)',
            //     delay: 0
            // });
            // tempAlphaAnimation.left(2000.0).step()
    
            // this.setData({
            //     mainAnimation1: tempAlphaAnimation.export()
            // })
        },
    },
})